<template>
	<view>
		<u-toast ref="uToast"></u-toast>
		<u-navbar :placeholder="true" @leftClick="goBack" title="会员卡记录"></u-navbar>
		<view v-if="paylogList.length<=0" style="margin-top: 200rpx;">
			<u-empty text="暂无历史记录" mode="history"></u-empty>
		</view>
		<view v-for="(item,index) in paylogList" :key="index" class="margin-sm radius bg-white padding-lg">
			<view class="flex justify-between align-start">
				<view>
					<view class="text-lg text-bold text-black">{{item.Type==0?'消费':'充值'}}</view>
					<view class="text-gray text-xs margin-top-sm">{{item.CreateTime}}</view>
				</view>
				<view class="flex flex-direction justify-between">
					<view class="text-bold">{{item.Price}}元</view>
					<view v-if="item.GivePrice>0" class="text-sm text-tea margin-top-xs">赠送{{item.GivePrice}}元
					</view>
				</view>
			</view>
		</view>
		<u-safe-bottom></u-safe-bottom>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				paylogList: []
			}
		},
		created() {
			this.getlog();
		},
		methods: {
			getlog() {
				uni.showLoading();
				uni.$u.http.post('/Customer/GetMemberPayLogList').then(res => {

					this.paylogList = res.data;
				});
			},
			goBack() {
				uni.navigateBack();
			}
		}

	}
</script>

<style>
</style>
